<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <link rel="shortcut icon" href="/static/favicon.ico"/>
</head>
<body>
<h1>欢迎光临
    当前登陆账号:<label th:text="${name}"></label>
    通过标签设置：:<label sec:authentication="name"></label>

</h1>
<p>点击<a th:href="@{/hello}">这里</a>打个招呼吧</p>
<form th:action="@{/logout}" method="post">
    <input type="submit" value="退出登陆">
</form>
<p sec:authorize="hasRole('ROLE_admin')"><a th:href="@{/hello/helloAdmin}">管理员</a></p>
<p sec:authorize="hasRole('ROLE_normal')"><a th:href="@{/hello/helloUser}">普通用户</a></p>
</body>
</html>